home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Installer SDK Cornucopia 1.0.2 / Script Examples / Rsrc Compression⁄Split Example / Makefile next >
Encoding:
Makefile  |  1996-09-24  |  5.6 KB  |  130 lines  |  [TEXT/MPS ]

  1. #
  2. #    makefile for "rsrcCompress.r", the example for InstaCompOne resource compression
  3. #
  4. #
  5. #        to build installer script :
  6. #            1) select "Build" from "Build" menu
  7. #            2) type script name "rsrcCompress" ( note: ".r" is omitted )
  8. #            
  9. #        to build debug version of installer script :
  10. #            1) select "Build" from "Build" menu
  11. #            2) type script name "rsrcCompress.debug" ( note: ".r" is omitted )
  12. #            
  13.  
  14. # • script names
  15.  
  16. # the installer script name
  17. scriptName                = rsrcCompress
  18. # the debug version installer script name
  19. debugScriptName            = "{scriptName}.debug"
  20. # filename for ScriptCheck extension that will run when ScriptCheck does
  21. localScriptCheckExtName    = {scriptName}.scx
  22.  
  23.  
  24. # • tool names
  25.  
  26. # InstaCompOne compression tool
  27. compressTool            = {InstaCompDir}InstaCompOneTool
  28.  
  29. # Splitting tool
  30. splitTool                = {InstaCompDir}FileAndRsrcSplitterTool
  31.  
  32. # Original ScriptCheck Extension
  33. ScriptCheckExtension    = {InstaCompDir}InstaCompOneSCExt.rsrc
  34.  
  35. # • support directory names
  36.  
  37. # directory where InstaCompeOne tools can be found
  38. InstaCompDir            = :::Tools:Released:InstaCompOne 1.1:
  39. # directory where ScriptCheck MPW tool can be found
  40. ScriptCheckDir            = :::Tools:Released:ScriptCheck 4.0.3:
  41. # directory where RIncludes can be found
  42. InstallerRIncDir        = :::DeveloperInterfaces:RIncludes:
  43. # directory where the Installer Debugger can be found
  44. InstallerDebuggerDir    = :::Tools:Released:Installer Debugger 4.0.3:
  45.  
  46.  
  47. # source file containing the three example STR# resources
  48. SourceFileName    = source.rsrc
  49.  
  50. # • simple compression example
  51.  
  52. # archive containing compressed resource
  53. CompressedRsrcArchive   = :Disk 1:CompressedRsrcTome
  54.  
  55. # • split compression example
  56.  
  57. # interim file containing both pieces of split resource
  58. TempSplitFile            = SplitResource
  59. # interim file containing first piece of split resource
  60. TempRenamedFile1        = SplitResourceRenamed1
  61. # interim file containing second piece of split resource
  62. TempRenamedFile2        = SplitResourceRenamed2
  63. # archive containing first split and compressed piece
  64. SplitCompRsrcArchive1   = :Disk 1:SplitCompRsrcTome1
  65. # archive containing second split and compressed piece
  66. SplitCompRsrcArchive2   = :Disk 2:SplitCompRsrcTome2
  67.  
  68.  
  69. # • split example
  70.  
  71. # interim file containing both pieces of split resource
  72. TempSplitFile2            = SplitResource2
  73. # archive containing first split piece
  74. SplitRsrcArchive1       = :Disk 1:SplitRsrcTome1
  75. # archive containing second split piece
  76. SplitRsrcArchive2       = :Disk 2:SplitRsrcTome2
  77.  
  78. # make the debug version of finished installer script
  79. "{debugScriptName}" ƒ {scriptName}
  80.     # make a copy of the finished installer script and rename the copy
  81.     Duplicate -y "{scriptName}" "{scriptName} w/ Debugger"
  82.     # add the installer debugger resources to the copied installer script
  83.     Rez -m "{InstallerDebuggerDir}Installer Debugger.r" -append -o "{scriptName} w/ Debugger"
  84.  
  85. # make the standard version of finished installer script
  86. "{scriptName}" ƒƒ makefile "{scriptName}.r" "{CompressedRsrcArchive}" "{SplitCompRsrcArchive1}" "{SplitRsrcArchive1}" "{localScriptCheckExtName}"
  87.     # establish current date with time of NOON
  88.     set theTime    "'`date -d -s` 12:00:00 PM'"
  89.     # rez the installer source into the form that the installer can read
  90.     Rez "{scriptName}.r" -o "{scriptName}" -t 'kajr' -c 'kajr' -i "{InstallerRIncDir}" 
  91.     # establish filename for finished installer script, set creation date and time, set attributes
  92.     SetFile -a b -d {theTime} "{scriptName}"
  93.     # run scriptcheck utility on the rezzed installer script
  94.     "{ScriptCheckDir}ScriptCheck" "{scriptName}" -h -d -a
  95.     # set modification date and time for finished installer script
  96.     SetFile -m {theTime} "{scriptName}"
  97.  
  98. # be sure that's there's a copy of the InstaCompOne ScriptCheck extension in current folder
  99. "{localScriptCheckExtName}" ƒ "{ScriptCheckExtension}"
  100.     # copy and rename the original scriptcheck extension
  101.     duplicate "{ScriptCheckExtension}" "{localScriptCheckExtName}"
  102.  
  103. # do the simple resource compression
  104. "{CompressedRsrcArchive}" ƒ makefile "{SourceFileName}"
  105.     # compress resource 'STR#' ( 9000 ) into a rsrc item within archive
  106.     "{compressTool}" "{SourceFileName}" -k 'STR#'=9000 -a 'part'=9000 -o "{CompressedRsrcArchive}"
  107.  
  108. # do the split compression
  109. "{SplitCompRsrcArchive1}" ƒ makefile "{SourceFileName}"
  110.     # split resource 'STR#' ( 9001 ) into parts no larger than 7K 
  111.     "{splitTool}" "{SourceFileName}" -k 'STR#'=9100 -s 7000 -a 'temp'=9100 -o "{TempSplitFile}"    
  112.     # give the first split piece the original resource type, copy into an interim file
  113.     echo "include ∂"{TempSplitFile}∂" 'temp'(9100) AS 'STR#'(9100);" | Rez -o "{TempRenamedFile1}" -t 'rsrc' -c 'RSED'
  114.     # compress contents of first rsrc piece within interim file into first archive
  115.     "{compressTool}" "{TempRenamedFile1}" -k 'STR#'=9100 -a part=9100 -o "{SplitCompRsrcArchive1}"     
  116.     # give the second split piece the original resource type, copy into another interim file
  117.     echo "include ∂"{TempSplitFile}∂" 'temp'(9101) AS 'STR#'(9100);" | Rez -o "{TempRenamedFile2}" -t 'rsrc' -c 'RSED'
  118.     # compress contents of second rsrc piece within interim file into second archive
  119.     "{compressTool}" "{TempRenamedFile2}" -k 'STR#'=9100 -a part=9101 -o "{SplitCompRsrcArchive2}" 
  120.  
  121. # do the split w/o compression
  122. "{SplitRsrcArchive1}" ƒ makefile "{SourceFileName}"
  123.     # split resource 'STR#' ( 9002 ) into parts no larger than 5K 
  124.     "{splitTool}" "{SourceFileName}" -k 'STR#'=9200 -s 5000 -a 'part'=9200 -o "{TempSplitFile2}"
  125.     # copy contents of first rsrc piece within interim file into first archive
  126.     Derez "{TempSplitFile2}" -only "'part'(9200)" | Rez -o "{SplitRsrcArchive1}" -t 'rsrc' -c 'RSED' -a    
  127.     # copy contents of second rsrc piece within interim file into second archive
  128.     Derez "{TempSplitFile2}" -only "'part'(9201)" | Rez -o "{SplitRsrcArchive2}" -t 'rsrc' -c 'RSED' -a    
  129.  
  130.